<%- include ("../public/page_header.html")%>

<div class="panel panel-default">
    <div class="table-responsive">
        <table class="table table-bordered">
            <thead>
                <tr class="th">
                    <th>名称</th>
                    <th>分类</th>
                    <th>图片</th>
                    <th>跳转地址</th>
                    <th class="text-center">排序</th>
                    <th class="text-center">状态</th>
                    <th class="text-center">操作</th>
                </tr>
            </thead>
            <tbody>
                <%for(var i=0;i<list.length;i++){%>
                    <tr>
                        <td><%=list[i].title%></td>
                        <td>
                            <%if(list[i].type==1){%>
                                网站
                            <%}else if(list[i].type==2){%>
                                app
                            <%}else if(list[i].type==3){%>
                                小程序
                            <%}%>
                        </td>
                        <td>
                            <%if(list[i].focus_img){%>
                                <img src="/<%=list[i].focus_img%>" width="80" />
                            <%}%>
                        </td>

                        <td><%=list[i].link%></td>
                        <td class="text-center">
                            <span class="chSpanNum" data-id="<%= list[i]._id %>" data-model="Focus" data-field="sort"><%=list[i].sort%></span>
                        </td>
                        <td align="center">
                            <%if(list[i].status==1){%>
                                <img src="/admin/images/yes.gif" class="chStatus" data-id="<%= list[i]._id %>" data-model="Focus" data-field="status" />
                            <%}else{%>
                                <img src="/admin/images/no.gif" class="chStatus" data-id="<%= list[i]._id %>" data-model="Focus" data-field="status" />
                            <%}%>
                        </td>
                        <td class="text-center">
                            <a href="/<%= adminPath %>/focus/edit?id=<%=list[i]._id%>">修改</a>
                            <a class="delete" href="/<%= adminPath %>/focus/delete?id=<%=list[i]._id%>">删除</a>
                        </td>
                    </tr>
                <%}%>
            </tbody>
        </table>
    </div>
</div>